<?php

class Control_User_ControlPanel extends QUI_Control_Abstract
{
    function render()
    {
        $app = Q::registry('app');
        $this->_view['user'] = $app->currentUser();
        if (empty($this->_view['user']))
		{
	        $this->_view['login_url'] = Q::ini('appini/passport/login_url');
    	    $this->_view['register_url'] = Q::ini('appini/passport/register_url');
		}
		else
		{
	        $this->_view['logout_url'] = url('default/logout');
    	    $this->_view['userinfo_url'] = Q::ini('appini/passport/profile_url');
		}
        return $this->_fetchView(dirname(__FILE__) . '/controlpanel_view.php');
    }
}


